import { RouteConfig } from "vue-router"

const routes: Array<RouteConfig> = [
  {
    path: "/products",
    name: "Products",
    component: () => import( "../views/product").then(product => product.List),
    props: (route) => ({
      name: route.query.name,
    }),
  },
  {
    path: "/products/:id",
    name: "Product",
    component: () => import( "../views/product"),
    props: true,
  },
  {
    path: "/products/:id/404",
    name: "ProductNotFound",
    component: () => import( "../views/product").then(product => product.NotFound),
    props: true,
  },
  {
    path: "/products/:productId/reviews",
    name: "ProductReviewList",
    component: () => import( "../views/product").then(product => product.ReviewList),
    props: true,
  },
]
export default routes
